from typing import Annotated

import msgspec
from litestar.contrib.sqlalchemy.dto import SQLAlchemyDTO
from litestar.dto import DTOConfig
from model.todo_item import TodoItem


class TodoItemDTO(SQLAlchemyDTO[TodoItem]):
    config = DTOConfig(include=["title", "done", "created_at"])  # type: ignore


class AddTodoItemForm(msgspec.Struct):
    title: Annotated[str, msgspec.Meta(max_length=10)]
    done: bool = False
